<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<?php
$data = $dataProvider->getData();
$pagination = $dataProvider->getPagination();
$currentPage = $pagination->currentPage+1;
$pageCount = $pagination->pageCount;
?>
<?php
if(empty($data) || count($data)==0){
	echo("<br><br><br><div id='message' class='updated'><p>没有满足条件的记录。</p></div>");
}else{
    $topPageCss = "";    $param = $_REQUEST;
    $param["page"]=1;
    $topPageUrl = Yii::app()->createUrl($this->getOwner()->route,$param);
    if($currentPage==1){
        $topPageCss = "disabled";
        $topPageUrl = "#";
    }
    $beforePageCss = "";    $param["page"]=$currentPage-1;
    $beforePageUrl = Yii::app()->createUrl($this->getOwner()->route,$param);
    if($currentPage==1){
        $beforePageCss = "disabled";
        $beforePageUrl = "#";
    }
    $nextPageCss = "";    $param["page"]=$currentPage+1;
    $nextPageUrl = Yii::app()->createUrl($this->getOwner()->route,$param);
    if($currentPage==$pageCount){
        $nextPageCss = "disabled";
        $nextPageUrl = "#";
    }
    $lastPageCss = "";    $param["page"]=$pagination->pageCount;
    $lastPageUrl = Yii::app()->createUrl($this->getOwner()->route,$param);
    if($currentPage==$pageCount){
        $lastPageCss = "disabled";
        $lastPageUrl = "#";
    }
	?>
<div class="tablenav bottom"><div class='tablenav-pages'><span class="displaying-num"><?php echo($pagination->itemCount)?>
个项目</span> <span class='pagination-links'><a
	class='first-page <?php echo($topPageCss);?>' title='前往第一页'
	href='<?php echo($topPageUrl);?>'>&laquo;</a> <a
	class='prev-page <?php echo($beforePageCss);?>' title='前往上一页'
	href='<?php echo($beforePageUrl);?>'>&lsaquo;</a> <span
	class="paging-input">第 <?php echo($currentPage);?>
页，共 <span class='total-pages'><?php echo($pagination->pageCount);?></span>
页</span> <a class='next-page <?php echo($nextPageCss);?>' title='前往下一页'
	href='<?php echo($nextPageUrl);?>'>&rsaquo;</a> <a
	class='last-page <?php echo($lastPageCss);?>' title='前往最后一页'
	href='<?php echo($lastPageUrl);?>'>&raquo;</a></span></div>
<br class="clear">

<table cellspacing="0" class="Miniyun-list-table widefat fixed users">
	<thead>
		<tr>
				<?php foreach(array_values($model->attributeLabels()) as $index=>$columnName):?>
			<th style="" class="manage-column column-username sortable desc"
				id="username" scope="col"><a href="#"><span><?php echo($columnName);?></span><span
				class="sorting-indicator"></span></a></th>
				<?php endforeach;?>
		</tr>
	</thead>

	<tfoot>
		<tr>
				<?php foreach(array_values($model->attributeLabels()) as $index=>$columnName):?>
			<th style="" class="manage-column column-username sortable desc"
				scope="col"><a href="#"><span><?php echo($columnName);?></span><span
				class="sorting-indicator"></span></a></th>
				<?php endforeach;?>
		</tr>
	</tfoot>
    <tbody class="list:user" id="the-list">
    	<?php
    	foreach($data as $index=>$item){
    		?>
    		<tr class="alternate" >
    			<?php foreach(array_keys($this->model->attributeLabels()) as $index1=>$key):?>
    			<td class="username column-username">
    			    <?php echo($item->{$key}); ?>
    			    <br>
    			<?php endforeach;?>
    			<td class="username column-username">
    			    <?php echo($item->doAction()); ?>
    			    <br>
    		</tr>
    		<?php }?>
    	</tbody>
    </table>
<div class="tablenav bottom">
<div class='tablenav-pages'><span class="displaying-num"><?php echo($pagination->itemCount)?>
个项目</span> <span class='pagination-links'><a
	class='first-page <?php echo($topPageCss);?>' title='前往第一页'
	href='<?php echo($topPageUrl);?>'>&laquo;</a> <a
	class='prev-page <?php echo($beforePageCss);?>' title='前往上一页'
	href='<?php echo($beforePageUrl);?>'>&lsaquo;</a> <span
	class="paging-input">第 <?php echo($currentPage);?>
页，共 <span class='total-pages'><?php echo($pagination->pageCount);?></span>
页</span> <a class='next-page <?php echo($nextPageCss);?>' title='前往下一页'
	href='<?php echo($nextPageUrl);?>'>&rsaquo;</a> <a
	class='last-page <?php echo($lastPageCss);?>' title='前往最后一页'
	href='<?php echo($lastPageUrl);?>'>&raquo;</a></span></div>
<br class="clear">
</div>
		<?php }?>

